<?php
if (!init()) {
  redirect('?action=login');
}

$timeStamp = getLocalTimeStamp();

$resultSet = createFlyComment($_POST['fid'], $_POST['content'], f_Date($timeStamp), f_Time($timeStamp), $_POST['reply']);


$initiatorAction = \controller\ControllerUtil::getEncodedActionFromUrlWithParameters($_SERVER['HTTP_REFERER']);

if ($resultSet) {
  increaseUsersMessages();
  redirect("?action=msg&header=header.fly.comment.success&body=body.fly.comment.success&view=" . $initiatorAction);
} else {
  redirect("?action=msg&header=header.fly.comment.failed&body=body.fly.comment.failed&view=" . $initiatorAction);
}
